/*
 * Copyright 2010-2011 Mike Novak <michael.novakjr@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.codeversed.plugins.buzz.receiver;

import android.content.ComponentName;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.util.Log;

import com.larvalabs.slidescreen.PluginReceiver;

import com.codeversed.plugins.buzz.R;
import com.codeversed.plugins.buzz.provider.BuzzContentProvider;
import com.codeversed.plugins.buzz.util.Constants;

public class BuzzPluginReceiver extends PluginReceiver {
    
    @Override
    public int getColor() {
        return Color.parseColor("#FF0000");
    }
    
    @Override
    public Uri getContentProviderURI() {
        return BuzzContentProvider.CONTENT_URI;
    }
    
    @Override
    public String getName() {
        return "Google Buzz";
    }
    
    @Override
    public int getIconResourceId() {
		return R.raw.ic_list_icon;
    }
    
    @Override
    public Intent[] getSingleTapShortcutIntents() {
        Intent[] intents = new Intent[2];
        Intent groupIntent = new Intent(Intent.ACTION_MAIN);
        groupIntent.setComponent(new ComponentName("com.codeversed.plugins.buzz", "com.codeversed.plugins.buzz.activity.BuzzComposeActivity"));
        intents[0] = groupIntent;
        intents[1] = new Intent(Intent.ACTION_VIEW, Uri.parse("http://buzz.google.com"));
        return intents;
    }
    
    @Override
    public Intent[] getLongpressShortcutIntents() {
        Intent[] intents = new Intent[2];
        Intent groupIntent = new Intent(Intent.ACTION_MAIN);
        groupIntent.setComponent(new ComponentName("com.codeversed.plugins.buzz", "com.codeversed.plugins.buzz.activity.BuzzComposeActivity"));
        intents[0] = groupIntent;
        intents[1] = new Intent(Intent.ACTION_VIEW, Uri.parse("http://buzz.google.com"));
        return intents;
    }
    
    @Override
    public Intent getPreferenceActivityIntent() {
        Intent prefs = new Intent(Intent.ACTION_MAIN);
        prefs.setComponent(new ComponentName("com.codeversed.plugins.buzz", 
                "com.codeversed.plugins.buzz.preference.BuzzPluginPreferences"));
        return prefs;
    }
    
    @Override
    public void markedAsRead(String itemId) {
        Log.d(Constants.LOG_TAG, "Received item marked as read: " + itemId);
    }
}
